/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.uah.es.snomedctsubsetextractor;

import java.util.Scanner;

/**
 *
 * @author Luis
 */
public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int n;
        
        System.out.println("Num args: "+args.length);

        if (args.length < 1) {
            System.out.println("You need to put more arguments to execute this program.");
        } else {

            try {

                do {

                    System.out.println("\t 1. Glossary to Snomed\n"
                            + "\t 2. Snomed Expander\n"
                            + "\t 3. Subset Extractor\n"
                            + "\t 4. Decomposer\n"
                            + "\t 5. Exit\n");

                    System.out.print("Enter Your choice:");
                    n = scan.nextInt();//Have to read only integers

                    switch (n) {
                        case 1:
                            ConverterGlossarySnomed.main(args);
                            break;
                        case 2:
                            Expander.main(args);
                            break;
                        case 3:
                            SubsetExtractor.main(args);
                            break;
                        case 4:
                            Decomposer.main(args);
                            break;
                        case 5:
                            System.out.println("::::::::THE END::::::::");
                            break;
                    }

                } while (n != 5);



            } catch (Exception e) {
                System.out.println("ERROR : " + e.getMessage());
                System.out.println("\n\n\tInvalid choice\n\tPlease Try again");
                Main.main(args);
            }
        }


        //System.out.println("::::::::THE END::::::::");


    }
}
